<?php require_once('Connections/dis01.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_dis01, $dis01);
$query_ls_versiculo = "SELECT verso_id, verso_descricao FROM versiculos ORDER BY verso_id DESC";
$ls_versiculo = mysql_query($query_ls_versiculo, $dis01) or die(mysql_error());
$row_ls_versiculo = mysql_fetch_assoc($ls_versiculo);
$totalRows_ls_versiculo = mysql_num_rows($ls_versiculo);
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['usu_login'])) {
  $loginUsername=$_POST['usu_login'];
  $password=$_POST['usu_senha'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "principal1001.php";
  $MM_redirectLoginFailed = "index.php";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_dis01, $dis01);
  
  $LoginRS__query=sprintf("SELECT usu_login, usu_senha FROM usuario WHERE usu_login=%s AND usu_senha=%s",
    GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 
   
  $LoginRS = mysql_query($LoginRS__query, $dis01) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
    
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;	      

    if (isset($_SESSION['PrevUrl']) && false) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>
<!DOCTYPE HTML5>
<html lang="pt-br">
<head>
<meta http-equiv="Content-Type" content="text/html; charset= UTF-8" />
<title>Disseminando.com</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="templatemo_style.css" rel="stylesheet" type="text/css" />

<link rel="stylesheet" href="css/orman.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/nivo-slider.css" type="text/css" media="screen" />	

<link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/ddsmoothmenu.js">

</script>

<script type="text/javascript">

ddsmoothmenu.init({
	mainmenuid: "templatemo_menu", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})

</script>

<link rel="stylesheet" href="css/slimbox2.css" type="text/css" media="screen" /> 
<script type="text/JavaScript" src="js/slimbox2.js"></script> 

</head>
<body id="home">

<div id="templatemo_wrapper">

	<div id="templatemo_header">
    	<div id="site_title"><img src="images/logo_projeto.png" width="296" height="76" /></div>
        <div id="templatemo_menu" class="ddsmoothmenu">
            <ul>
                <li><a href="index.php" class="selected">Inicio</a></li>
            </ul>
            <br style="clear: left" />
        </div> <!-- end of templatemo_menu -->
    </div> <!-- END of header -->
    
    <div id="templatemo_slider"><span class="sliderframe"></span>
    	 <div class="slider-wrapper theme-orman">
            <div id="slider" class="nivoSlider">
            	<img src="images/slider/01.jpg" alt="slider image 2" title="#htmlcaption" />
                <img src="images/slider/02.jpg" alt="slider image 2" title="#htmlcaption"/>
                <img src="images/slider/03.jpg" alt="slider image 2" title="#htmlcaption" />
                <img src="images/slider/04.jpg" alt="slider image 4" title="#htmlcaption"/>
            </div>
            <div id="htmlcaption" class="nivo-html-caption">
                <strong>Contato: antoniomarcosborges2008@gmail.com</strong>.
            </div>
        </div> 
		<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
        <script type="text/javascript" src="js/jquery.nivo.slider.pack.js"></script>
        <script type="text/javascript">
        $(window).load(function() {
            $('#slider').nivoSlider({
				controlNav:false,
   			 directionNavHide: false
			});
        });
        </script>
    </div><!-- END of templatemo_slider -->
    
    <div id="templatemo_twitter">
    	<?php echo $row_ls_versiculo['verso_descricao']; ?>
    </div> <!-- END of twitter -->
    
    <div id="templatemo_main">
    
    	<div id="templatemo_content" class="left">
        
            <h2>Acesso Restrito </h2>
        <div class="clear"></div>         
            <hr />
            <form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
              <table width="100%" border="0" cellspacing="1" cellpadding="1">
                <tr>
                  <td width="30%" rowspan="4"><img src="images/cadeado01.png" width="207" height="137" /></td>
                  <td width="70%"><strong>Usuario:
                      <label>
                        <input name="usu_login" type="text" id="usu_login" size="30" maxlength="20" />
                      </label>
                  </strong></td>
                </tr>
                <tr>
                  <td><strong>Senha..:
                      <label>
                        <input name="usu_senha" type="password" id="usu_senha" size="30" maxlength="20" />
                      </label>
                  </strong></td>
                </tr>
                <tr>
                  <td><label>
                    <input type="submit" name="entrada" id="entrada" value="Acessar" />
                  </label></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
              </table>
            </form>
            <br />
            <br />
    	</div>
		
</div> <!-- END of content -->
                
		<div id="templatemo_sidebar" class="right">
			
			<div class="sidebar_section">
                <h2>Publicações</h2>
                <a href="publicacao1001.php"><img src="images/evangelismo.png" alt="services" class="img_nom img_border" /></a>
			</div>
            <div class="sidebar_section">
            	<script language="JavaScript"> function abrir(URL) {     var width = 550;   var height = 760;     var left = 99;   var top = 99;     window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');   } </script> <a href="javascript:abrir('http://www.publicidadegospel.com/Suporte/chat.php?a=97cea');"><img alt="Clique e ouça!" title="WEB RADIO RGA" src="http://builder01.hstbr.net/uploads_images/2950/519ebccb7f456cd013c04dd63ca8c671.gif" border="0" width="256" height="177"/></a><br/> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="256" height="24" id="player" name="player">   <param name="movie" value="http://streaming15.hstbr.net/static/jwplayer/player_simple.swf" />   <param name="allowfullscreen" value="true" />   <param name="allowscriptaccess" value="always" />   <param name="wmode" value="transparent" />   <param name="flashvars" value="file=http://streaming15.hstbr.net:8124/live?type=.flv&provider=video&autostart=true&skin=http://streaming15.hstbr.net/static/jwplayer/skin.zip" /><embed type="application/x-shockwave-flash" src="http://streaming15.hstbr.net/static/jwplayer/player_simple.swf" width="256" height="24" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" flashvars="file=http://streaming15.hstbr.net:8124/live?type=.flv&provider=video&autostart=true&skin=http://streaming15.hstbr.net/static/jwplayer/skin.zip" />            </object> 
            </div>
            
      </div>
        
        <div class="clear"></div>


</div> <!-- END of wrapper -->

<div id="templatemo_bottom_wrapper">
	<div id="templatemo_bottom">
    	
        <div class="col col_3">
          
       <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div> <!-- END of bottom -->
    
</div> <!-- END of bottom wrapper -->

<div id="templatemo_footer_wrapper">
	<div id="templatemo_footer">
	
    	  <?php include ('rodape.php') ?>
		  
    </div> <!-- END of footer -->
</div> <!-- END of footer wrapper -->

</body>
</html>
<?php
mysql_free_result($ls_versiculo);
?>
